import request from '@/utils/request'

export function fetchPrdFuncList(query) {
  return request({
    url: '/prd_func_dict/page',
    method: 'get',
    params: query
  })
}

export function exportPrdFuncList(query) {
  return request({
    url: '/prd_func_dict/export',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

export function createPrdFunc(data) {
  return request({
    url: '/prd_func_dict',
    method: 'post',
    data
  })
}

export function updatePrdFunc(data) {
  return request({
    url: `/prd_func_dict/${data.id}`,
    method: 'put',
    data
  })
}

export function deletePrdFunc(id) {
  return request({
    url: `/prd_func_dict/${id}`,
    method: 'delete'
  })
}

export function changePrdFuncStatus(data) {
  return request({
    url: `/prd_func_dict/${data.id}`,
    method: 'put',
    data
  })
}
